package com.neusoft.tijian.mapper;

import com.neusoft.tijian.po.Hospital;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface HospitalMapper {
    //查询正常营业的医院列表
    @Select("select * from hospital where state=#{state} order by hpId")
    public List<Hospital> listHospital(Integer state);

    /**
     * 根据主键查询医院信息
     *
     * @param hpId 主键
     * @return 医院
     */
    @Select("SELECT * FROM hospital WHERE hpId = #{hpId}")
    public Hospital getHospitalById(Integer hpId);
}
